-- CSCI 4430
-- Charles Douglas
-- Jeff Taylor


-- case [x..]
f1 x = (x:f1 (x+1))

-- case [x..y]
f2 x y | x <= y =  (x:f2 (x+1) y)
f2 _ _ = []

-- case [x,y..]
f3 x y = (x: f3 y (2*y-x))

-- case [x,y..z] (also works for negative values)
f4 x y z | (if x < y then z-x >= 0 else z-x <= 0) = (x: f4 y (2*y-x) z)
f4 _ _ _ = []